﻿
Partial Class Default2
    Inherits System.Web.UI.Page
    Dim ocnInstitucion As New Negocio.Institucion

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Try
            ocnInstitucion.RegistrarInstitucion(Me.TBnombre.Text, Me.TBpais.Text)
            Me.GridView1.DataSource = ocnInstitucion.obtenerListaInstituciones()
            Me.GridView1.DataBind()
        Catch ex As Exception
            Session.Add("Error", ex.Message)
            Response.Redirect("ManejarErrores.aspx")
        End Try
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.GridView1.DataSource = ocnInstitucion.obtenerListaInstituciones()
        Me.GridView1.DataBind()
    End Sub
End Class
